package data.visitor;

import client.gui.roombox.RoomBoxView;
import data.Data;
import data.content.visitor.ShowContentVisitor;

public class ShowDataVisitor extends DataVisitor<Void> {
  
  private final RoomBoxView box_;
  
  public ShowDataVisitor(RoomBoxView box) {
    assert box != null;
    box_ = box;
  }
  
  @Override
  public Void visit(Data data) {
    box_.appendText("<b>" + data.getCreator().getName() + "</b>:");
    data.getContent().accept(new ShowContentVisitor(box_));
    return null;
  }
  
}
